<?xml version="1.0"?>
<ruleset name="OpenEMR Standard">
  <description>PSR2 (permissive)</description>
  <arg name="tab-width" value="4" />
  <rule ref="PSR2">
    <exclude name="PSR1.Classes.ClassDeclaration"/>
    <exclude name="Squiz.Classes.ValidClassName"/>
    <exclude name="PSR1.Methods.CamelCapsMethodName"/>
    <exclude name="Squiz.Scope.MethodScope"/>
    <exclude name="PEAR.Functions.ValidDefaultValue"/>
    <exclude name="PSR2.Classes.PropertyDeclaration"/>
    <exclude name="Generic.NamingConventions.UpperCaseConstantName"/>
    <exclude name="Squiz.WhiteSpace.ScopeClosingBrace"/> <!-- ~100 files need fixing from this -->
  </rule>

  <!-- Checks that the opening PHP tag is the first content in a file. -->
  <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
  <!-- Indenting -->
  <!-- Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting. -->
  <rule ref="Generic.WhiteSpace.ScopeIndent">
    <properties>
      <property name="ignoreIndentationTokens" type="array" value="T_COMMENT,T_DOC_COMMENT_OPEN_TAG" />
    </properties>
  </rule>

  <exclude-pattern>*/vendor/*</exclude-pattern>
  <exclude-pattern>*/gacl/*</exclude-pattern>
  <exclude-pattern>*/bower_components/*</exclude-pattern>
  <exclude-pattern>*/node_modules/*</exclude-pattern>
  <exclude-pattern>*/public/assets/*</exclude-pattern>
  <exclude-pattern>*/Documentation/*</exclude-pattern>
  <exclude-pattern>*/tests/*</exclude-pattern>
  <exclude-pattern>*/images/*</exclude-pattern>
  <exclude-pattern>*/library/html2pdf/*</exclude-pattern>
  <exclude-pattern>*/library/classes/fpdf/*</exclude-pattern>
  <exclude-pattern>*/library/classes/smtp/*</exclude-pattern>
  <exclude-pattern>*/library/classes/PDF_Label.php</exclude-pattern>
  <exclude-pattern>*/library/custom_template/*</exclude-pattern>
  <exclude-pattern>*/library/fonts/*</exclude-pattern>
</ruleset>
